/*
 * Copyright 2004 original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.ayan.generic;

/**
 * This class is a simple data holder utility for GComparator.It will contain
 * the field name and sorting mode of the field(s) to be sorted 
 * 
 * @author Ayan Dutta
 *
 */
public class SortingFieldInfo 
{
    private String fieldNameToBeSorted;
    //By default the sortingMode is assumed as true i.e. ascending
    private boolean sortingMode=true;
     
    //Prevent/restrict initialization without fieldNameToBeSorted property
    private SortingFieldInfo(){};
     
    /**
     * This constructor allows to pass the fieldNameToBeSorted property
     * @param fieldNameToBeSorted
     */
    public SortingFieldInfo(String fieldNameToBeSorted)
    {
        this.fieldNameToBeSorted=fieldNameToBeSorted;
    }
    /**
     * This constructor allows to pass the fieldNameToBeSorted and 
     * sortingMode property.
     * @param fieldNameToBeSorted
     * @param sortingMode
     */
    public SortingFieldInfo(String fieldNameToBeSorted,boolean sortingMode)
    {
        this.fieldNameToBeSorted=fieldNameToBeSorted;
        this.sortingMode=sortingMode;
    }
     
    //getters and setters...
    public String getFieldNameToBeSorted() {
        return fieldNameToBeSorted;
    }
    public void setFieldNameToBeSorted(String fieldNameToBeSorted) {
        this.fieldNameToBeSorted = fieldNameToBeSorted;
    }
    public boolean getSortingMode() {
        return sortingMode;
    }
    public void setSortingMode(boolean sortingMode) {
        this.sortingMode = sortingMode;
    }
}
